import gameManager from "./gameManager";

const {ccclass, property} = cc._decorator;

@ccclass
export default class startPanel extends cc.Component {

    @property(cc.Node)
    startBtn:cc.Node = null;

    private game:gameManager = null;

    init(game:gameManager){
        this.game = game
    }
    onLoad () {
        this.startBtn.on('touchstart',this.touchStart,this)
    }

    private touchStart(){
        cc.tween(this.startBtn).to(0.1,{scale:0.9}).to(0.1,{scale:1}).call(()=>{
            this.node.active = false
            this.game.isStart = true
            this.game.startGame()
        }).start()
    }

    start () {

    }

    // update (dt) {}
}
